package com.niit.chat.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.niit.chat.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 用户Mapper接口
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 根据用户ID获取昵称
     *
     * @param userId 用户ID
     * @return 用户昵称
     */
    @Select("SELECT nickname FROM tb_user WHERE id = #{userId}")
    String getNicknameById(Long userId);
}
